#include "MotionIntegration.h"

MotionIntegration::MotionIntegration(const Particle& p_in, const Flag& pFlag, 
	const PLinearMotion& pLinerMotion, const TimeStepSize& pTimeStepSize)
{
	pOut = p_in;
	if (pFlag.active)
	{
		// explicit euler method
		pOut.V[0] = p_in.V[0] + pLinerMotion.accDrag[0] * pTimeStepSize.timeStepSize;
		pOut.V[1] = p_in.V[1] + pLinerMotion.accDrag[1] * pTimeStepSize.timeStepSize;
		pOut.pos[0]= p_in.pos[0]+ p_in.V[0]* pTimeStepSize.timeStepSize;
		pOut.pos[1] = p_in.pos[1] + p_in.V[1] * pTimeStepSize.timeStepSize;
	}

}